unit CancelaAcresDescIMFD;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons;

type
  TFormCancelaAcresDescIMFD = class(TForm)
    GroupBox1: TGroupBox;
    RBAcrescimo: TRadioButton;
    RBDesconto: TRadioButton;
    RBUltimo: TRadioButton;
    RBUltimoT: TRadioButton;
    BitBtn1: TBitBtn;
    Label1: TLabel;
    Edit1: TEdit;
    procedure BitBtn1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormCancelaAcresDescIMFD: TFormCancelaAcresDescIMFD;

implementation

uses principal;

{$R *.dfm}

procedure TFormCancelaAcresDescIMFD.BitBtn1Click(Sender: TObject);
begin
        if rbDesconto.Checked then FormPrincipal.TipoDescontoAcrescimo:= 'D'
        else if rbAcrescimo.Checked then FormPrincipal.TipoDescontoAcrescimo:= 'A'
        else if rbUltimo.Checked then FormPrincipal.TipoDescontoAcrescimo:= 'U'
        else  FormPrincipal.TipoDescontoAcrescimo:= 'X';
        FormPrincipal.ItemDesc:=Edit1.Text;
        Close;
end;

procedure TFormCancelaAcresDescIMFD.FormShow(Sender: TObject);
begin
        if FormCancelaAcresDescIMFD.Caption='Cancela Acréscimo Desconto Subtotal MFD' then begin
                Label1.Visible:=false; Edit1.Visible:=False;
        end
        else begin
                Label1.Visible:=true; Edit1.Visible:=true;
        end;
end;

end.
